%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%%  Copyright (c) 2007-2020 VMware, Inc. or its affiliates.  All rights reserved.
%%

-module(rabbit_delayed_message_app).

-behaviour(application).
-export([start/2, stop/1]).

%% Same idea as for federation. We need to make sure
%% rabbit_delayed_message.erl is running to make it start publishing
%% delayed messages that might have been persisted but not published
%% yet.
-behaviour(supervisor).
-export([init/1]).

start(_Type, _StartArgs) ->
    rabbit_delayed_message:go(),
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).

stop(_State) ->
    ok.
%%----------------------------------------------------------------------------

init([]) -> {ok, {{one_for_one, 3, 10}, []}}.
